package com.niiwoo.civet.account.dto.request;

import com.niiwoo.civet.account.enums.OrderTypeEnum;
import com.niiwoo.civet.base.dto.BaseFeeDetailDTO;
import com.niiwoo.civet.base.enums.BorrowProjectTypeEnum;
import com.niiwoo.civet.base.enums.OrderRefundTypeEnum;
import com.niiwoo.tripod.lanmao.enums.BusinessTypeEnum;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 回款记账请求
 * Created by wangjichao on 2018/4/20.
 */
@Getter
@Setter
public class ReceivedRepaymentSuccessAccountingRequestDTO implements Serializable {

    private static final long serialVersionUID = -3974068151844393906L;
    /**
     * 交易中心订单ID
     */
    @NotNull
    private Long orderId;

    /**
     * 交易中心批量交易detailRequestNo
     */
    @NotBlank
    private String detailRequestNo;

    /**
     * 订单类型
     */
    @NotNull
    private OrderTypeEnum orderType;

    /**
     * 还款类型：换款时必填
     */
    private OrderRefundTypeEnum orderRefundTypeEnum;

    /**
     * 需要额外扣除的待收利息
     */
    @NotNull
    private BigDecimal expectInterest;

    /**
     * 对应存管业务
     */
    @NotNull
    private BusinessTypeEnum businessTypeEnum;

    /**
     * 项目ID
     */
    @NotNull
    private Long projectId;

    /**
     * 项目类型
     */
    @NotNull
    private BorrowProjectTypeEnum borrowProjectTypeEnum;

    /**
     * 项目ID
     */
    @NotBlank
    private String projectTitle;

    /**
     * 当前期数
     */
    private Integer currentPeriod;

    /**
     * 总期数
     */
    private Integer totalPeriods;

    /**
     * 收款账户ID
     */
    @NotNull
    private Long receivedAccountId;

    /**
     * 还款方账户ID
     */
    @NotNull
    private Long repaymentAccountId;

    /**
     * 投资订单ID 平台/担保公司 收取费用无需传递此字段
     */
    private Long investId;

    /**
     * 回款金额
     */
    @NotNull
    private BigDecimal amount;

    /**
     * 费用明细
     */
    @NotEmpty
    List<BaseFeeDetailDTO> feeDetailDTOList;

    /**
     * 债权出让人已收利息(受让人的已挣收益需要减去这部分)
     */
    private BigDecimal creditorSaleInterest;
}
